import javax.swing.*;

public class File extends JFrame {
    JMenu file,edit;
    JMenuBar jMenuBar;
    JMenuItem new_build,open,save,exit,select_all,copy,shear,stickup;

    public File(){
        setSize(800,600);
        setTitle("Java记事本");
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        jMenuBar = new JMenuBar();

        file = new JMenu("文件操作");
        new_build = new JMenuItem("新建");
        open = new JMenuItem("打开");
        save = new JMenuItem("保存");
        exit = new JMenuItem("退出");
        file.add(new_build);
        file.add(open);
        file.add(save);
        file.add(exit);

        edit = new JMenu("文件编辑");
        select_all = new JMenuItem("全选");
        copy = new JMenuItem("复制");
        shear = new JMenuItem("剪切");
        stickup = new JMenuItem("粘贴");
        edit.add(select_all);
        edit.add(copy);
        edit.add(shear);
        edit.add(stickup);

        jMenuBar.add(file);
        jMenuBar.add(edit);
        setJMenuBar(jMenuBar);

        setVisible(true);
    }

    public static void main(String[] args) {
        new File();
    }
}


